package ym.ecrm.core.domain.salesManagement;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import ym.ecrm.core.domain.base.BaseEntity;
import ym.ecrm.core.domain.customerManagement.Customer;
import ym.ecrm.core.domain.systemManagement.User;

/**
 * 销售机会
 * 
 * @author Princess
 * @version 1.0
 */
@Entity
@Table(name = "t_salesOpportunity")
public class SalesOpportunity extends BaseEntity{
	/**
	 * 机会编号
	 */
	private String salesOpportunityCode;
	/**
	 * 机会主题
	 */
	private String salesOpportunityTheme;
	/**
	 * 客户
	 */
	@ManyToOne
	private Customer customer;
	/**
	 * 来源
	 */
	private String source;
	/**
	 * 发现时间
	 */
	private String foundTime;		
	/**
	 * 可能性
	 */
	private String possibility;	
	/**
	 * 预计销售金额
	 */
	private double expectAmountOfSales;
	/**
	 * 预计销售日期
	 */
	private Date expectDateOfSales;
	/**
	 * 阶段
	 */
	private String stage;
	/**
	 * 状态
	 */
	private String SalesOpportunityStatus;          

	/**
	 * 涉及的产品
	 */
	@OneToMany
	private Set<Production> productions = new HashSet<Production>();
	/**
	 * 负责人
	 */
	@ManyToOne
	@JoinColumn(name="user_id")
	private User user;
	public String getSalesOpportunityCode() {
		return salesOpportunityCode;
	}
	public void setSalesOpportunityCode(String salesOpportunityCode) {
		this.salesOpportunityCode = salesOpportunityCode;
	}
	public String getSalesOpportunityTheme() {
		return salesOpportunityTheme;
	}
	public void setSalesOpportunityTheme(String salesOpportunityTheme) {
		this.salesOpportunityTheme = salesOpportunityTheme;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public String getFoundTime() {
		return foundTime;
	}
	public void setFoundTime(String foundTime) {
		this.foundTime = foundTime;
	}
	public String getPossibility() {
		return possibility;
	}
	public void setPossibility(String possibility) {
		this.possibility = possibility;
	}
	public double getExpectAmountOfSales() {
		return expectAmountOfSales;
	}
	public void setExpectAmountOfSales(double expectAmountOfSales) {
		this.expectAmountOfSales = expectAmountOfSales;
	}
	public Date getExpectDateOfSales() {
		return expectDateOfSales;
	}
	public void setExpectDateOfSales(Date expectDateOfSales) {
		this.expectDateOfSales = expectDateOfSales;
	}
	public String getStage() {
		return stage;
	}
	public void setStage(String stage) {
		this.stage = stage;
	}
	public String getSalesOpportunityStatus() {
		return SalesOpportunityStatus;
	}
	public void setSalesOpportunityStatus(String salesOpportunityStatus) {
		SalesOpportunityStatus = salesOpportunityStatus;
	}
	public Set<Production> getProductions() {
		return productions;
	}
	public void setProductions(Set<Production> productions) {
		this.productions = productions;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
}
